
public class StringBuilderTest {
    public static void main(String[] args) {
        /**
         * StringBuilder 避免每次连接字符串都需要构建一个新的String,耗费时间以及空间.
         */
        StringBuilder str = new StringBuilder();

        str.append("hello");
        str.append("ni");
        str.append("hao");

        String complatefBuilder  = str.toString();
        System.out.println(complatefBuilder);

    }
}